/** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ package org.wikipedia.miner.extract.model.struct; @SuppressWarnings("all") @org.apache.avro.specific.AvroGenerated public class PageSummary extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"PageSummary\",\"namespace\":\"org.wikipedia.miner.extract.model.struct\",\"fields\":[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"namespace\",\"type\":\"int\"},{\"name\":\"forwarded\",\"type\":\"boolean\"}]}"); public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } @Deprecated public int id; @Deprecated public java.lang.CharSequence title; @Deprecated public int namespace; @Deprecated public boolean forwarded; /** * Default constructor. Note that this does not initialize fields * to their default values from the schema. If that is desired then * one should use {@link \#newBuilder()}. */ public PageSummary() {} /** * All-args constructor. */ public PageSummary(java.lang.Integer id, java.lang.CharSequence title, java.lang.Integer namespace, java.lang.Boolean forwarded) { this.id = id; this.title = title; this.namespace = namespace; this.forwarded = forwarded; } public org.apache.avro.Schema getSchema() { return SCHEMA$; } // Used by DatumWriter. Applications should not call. public java.lang.Object get(int field$) { switch (field$) { case 0: return id; case 1: return title; case 2: return namespace; case 3: return forwarded; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } // Used by DatumReader. Applications should not call. @SuppressWarnings(value="unchecked") public void put(int field$, java.lang.Object value$) { switch (field$) { case 0: id = (java.lang.Integer)value$; break; case 1: title = (java.lang.CharSequence)value$; break; case 2: namespace = (java.lang.Integer)value$; break; case 3: forwarded = (java.lang.Boolean)value$; break; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } /** * Gets the value of the 'id' field. */ public java.lang.Integer getId() { return id; } /** * Sets the value of the 'id' field. * @param value the value to set. */ public void setId(java.lang.Integer value) { this.id = value; } /** * Gets the value of the 'title' field. */ public java.lang.CharSequence getTitle() { return title; } /** * Sets the value of the 'title' field. * @param value the value to set. */ public void setTitle(java.lang.CharSequence value) { this.title = value; } /** * Gets the value of the 'namespace' field. */ public java.lang.Integer getNamespace() { return namespace; } /** * Sets the value of the 'namespace' field. * @param value the value to set. */ public void setNamespace(java.lang.Integer value) { this.namespace = value; } /** * Gets the value of the 'forwarded' field. */ public java.lang.Boolean getForwarded() { return forwarded; } /** * Sets the value of the 'forwarded' field. * @param value the value to set. */ public void setForwarded(java.lang.Boolean value) { this.forwarded = value; } /** Creates a new PageSummary RecordBuilder */ public static org.wikipedia.miner.extract.model.struct.PageSummary.Builder newBuilder() { return new org.wikipedia.miner.extract.model.struct.PageSummary.Builder(); } /** Creates a new PageSummary RecordBuilder by copying an existing Builder */ public static org.wikipedia.miner.extract.model.struct.PageSummary.Builder newBuilder(org.wikipedia.miner.extract.model.struct.PageSummary.Builder other) { return new org.wikipedia.miner.extract.model.struct.PageSummary.Builder(other); } /** Creates a new PageSummary RecordBuilder by copying an existing PageSummary instance */ public static org.wikipedia.miner.extract.model.struct.PageSummary.Builder newBuilder(org.wikipedia.miner.extract.model.struct.PageSummary other) { return new org.wikipedia.miner.extract.model.struct.PageSummary.Builder(other); } /** * RecordBuilder for PageSummary instances. */ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<PageSummary> implements org.apache.avro.data.RecordBuilder<PageSummary> { private int id; private java.lang.CharSequence title; private int namespace; private boolean forwarded; /** Creates a new Builder */ private Builder() { super(org.wikipedia.miner.extract.model.struct.PageSummary.SCHEMA$); } /** Creates a Builder by copying an existing Builder */ private Builder(org.wikipedia.miner.extract.model.struct.PageSummary.Builder other) { super(other); if (isValidValue(fields()[0], other.id)) { this.id = data().deepCopy(fields()[0].schema(), other.id); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.title)) { this.title = data().deepCopy(fields()[1].schema(), other.title); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.namespace)) { this.namespace = data().deepCopy(fields()[2].schema(), other.namespace); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.forwarded)) { this.forwarded = data().deepCopy(fields()[3].schema(), other.forwarded); fieldSetFlags()[3] = true; } } /** Creates a Builder by copying an existing PageSummary instance */ private Builder(org.wikipedia.miner.extract.model.struct.PageSummary other) { super(org.wikipedia.miner.extract.model.struct.PageSummary.SCHEMA$); if (isValidValue(fields()[0], other.id)) { this.id = data().deepCopy(fields()[0].schema(), other.id); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.title)) { this.title = data().deepCopy(fields()[1].schema(), other.title); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.namespace)) { this.namespace = data().deepCopy(fields()[2].schema(), other.namespace); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.forwarded)) { this.forwarded = data().deepCopy(fields()[3].schema(), other.forwarded); fieldSetFlags()[3] = true; } } /** Gets the value of the 'id' field */ public java.lang.Integer getId() { return id; } /** Sets the value of the 'id' field */ public org.wikipedia.miner.extract.model.struct.PageSummary.Builder setId(int value) { validate(fields()[0], value); this.id = value; fieldSetFlags()[0] = true; return this; } /** Checks whether the 'id' field has been set */ public boolean hasId() { return fieldSetFlags()[0]; } /** Clears the value of the 'id' field */ public org.wikipedia.miner.extract.model.struct.PageSummary.Builder clearId() { fieldSetFlags()[0] = false; return this; } /** Gets the value of the 'title' field */ public java.lang.CharSequence getTitle() { return title; } /** Sets the value of the 'title' field */ public org.wikipedia.miner.extract.model.struct.PageSummary.Builder setTitle(java.lang.CharSequence value) { validate(fields()[1], value); this.title = value; fieldSetFlags()[1] = true; return this; } /** Checks whether the 'title' field has been set */ public boolean hasTitle() { return fieldSetFlags()[1]; } /** Clears the value of the 'title' field */ public org.wikipedia.miner.extract.model.struct.PageSummary.Builder clearTitle() { title = null; fieldSetFlags()[1] = false; return this; } /** Gets the value of the 'namespace' field */ public java.lang.Integer getNamespace() { return namespace; } /** Sets the value of the 'namespace' field */ public org.wikipedia.miner.extract.model.struct.PageSummary.Builder setNamespace(int value) { validate(fields()[2], value); this.namespace = value; fieldSetFlags()[2] = true; return this; } /** Checks whether the 'namespace' field has been set */ public boolean hasNamespace() { return fieldSetFlags()[2]; } /** Clears the value of the 'namespace' field */ public org.wikipedia.miner.extract.model.struct.PageSummary.Builder clearNamespace() { fieldSetFlags()[2] = false; return this; } /** Gets the value of the 'forwarded' field */ public java.lang.Boolean getForwarded() { return forwarded; } /** Sets the value of the 'forwarded' field */ public org.wikipedia.miner.extract.model.struct.PageSummary.Builder setForwarded(boolean value) { validate(fields()[3], value); this.forwarded = value; fieldSetFlags()[3] = true; return this; } /** Checks whether the 'forwarded' field has been set */ public boolean hasForwarded() { return fieldSetFlags()[3]; } /** Clears the value of the 'forwarded' field */ public org.wikipedia.miner.extract.model.struct.PageSummary.Builder clearForwarded() { fieldSetFlags()[3] = false; return this; } @Override public PageSummary build() { try { PageSummary record = new PageSummary(); record.id = fieldSetFlags()[0] ? this.id : (java.lang.Integer) defaultValue(fields()[0]); record.title = fieldSetFlags()[1] ? this.title : (java.lang.CharSequence) defaultValue(fields()[1]); record.namespace = fieldSetFlags()[2] ? this.namespace : (java.lang.Integer) defaultValue(fields()[2]); record.forwarded = fieldSetFlags()[3] ? this.forwarded : (java.lang.Boolean) defaultValue(fields()[3]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } } }